package com.lbd.system.bean;

import com.lbd.base.bean.AbstractEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.NumberFormat;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 交易记录流水
 * Created by zzl on 2016/9/27.
 */
@Getter
@Setter
@ToString
@AllArgsConstructor
@NoArgsConstructor
@DynamicUpdate
@Entity
@Table(name = "trading_record")
public class Record extends AbstractEntity {
    //交易类别
    public static final int CATEGORY_1 = 1;//充值
    public static final int CATEGORY_2 = 2;//提现
    public static final int CATEGORY_3 = 3;//投资
    public static final int CATEGORY_4 = 4;//回款
    public static final int CATEGORY_5 = 5;//借款人放款
    public static final int CATEGORY_6 = 6;//借款人回款

    //投资状态 :1处理中,2,成功,3失败,4,其他
    public static final int STATE_PROCESSING = 1;
    public static final int STATE_SUCCESS = 2;
    public static final int STATE_FAIL = 3;

    //手续费支付方1平台2用户
    public static final int SERVICEFEE_CHARGE_PARTY_PLATFORM = 1;
    public static final int SERVICEFEE_CHARGE_PARTY_USER = 2;

    //交易信息来源
    public static final int PLATFORM_PC = 1;
    public static final int PLATFORM_WC = 2;
    public static final int PLATFORM_APP = 3;

    //类别 1充值,2提现,3投资,4流标,5放款6,回款,7,还款
    Integer type;
    //状态:1,成功,2失败,3,等待
    Integer state;
    //交易流水号
    String tradeNo;
    //交易金额
    String amount;
    //明细
    String detail;
    //备注
    String remark;
    //    银行卡号
    String bankCard;
    //    投资账号
    String investAccount;
    //    订单id
    String orderId;
    // 优惠金额
    String discountAmount;
    //服务费
    String serviceCharge;
    //手续费支付方1平台2用户
    Integer serviceChargeParty;
    //交易完当前账户余额
    String balance;
    //实际交易金额
    String actualAmount;
    //交易平台
    Integer platform;
    //用户ID
    //所属用户
    @ManyToOne
    @JoinColumn(name = "user_id")
    User user;
    //结束时间
    Date finishTime;
    @Transient
    Object recordProperty;
}
